﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CastleDynamicProxyTest
{
    public interface IWorker
    {
        void Excute();
        Task ExcuteAsync();
        Task<int> ExcuteAsync(int a);
        void NonHook();
        void Start();
        void Stop();
    }

    public class Worker : IWorker
    {
        public void Start()
        {
            Console.WriteLine("Start");
        }
        public void Excute()
        {
            Console.WriteLine("Excute");
        }
        public Task ExcuteAsync()
        {
            Console.WriteLine("ExcuteAsync");
            return Task.CompletedTask;
        }

        public Task<int> ExcuteAsync(int a)
        {
            Console.WriteLine("ExcuteAsync");

            return Task.FromResult(a);
        }

        public void NonHook()
        {
            Console.WriteLine("这是不被拦截的方法");
        }

        public void Stop()
        {
            Console.WriteLine("Stop");
        }
    }
}
